package com.xmh.autocode.main;

import com.xmh.autocode.AutocodeApplication;
import com.xmh.autocode.filecrate.ModeFileCreate;
import com.xmh.autocode.filecrate.VoCreate;
import com.xmh.autocode.filecrate.XmlCreate;
import com.xmh.autocode.util.DataUtils;
import com.xmh.autocode.vo.TableVo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.stereotype.Component;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

/**
 * 代码自动生成
 *
 * @author xmh
 */
@RunWith(SpringRunner.class)
@Component
@SpringBootTest(classes = AutocodeApplication.class)
public class AutomaticCodeGenerationBySBM {

    // Configure the table name of the form you need to create, default create data base all table
    private static final String[] table_Name_List = {};

    @Test
    public void create() throws Exception {
        List<TableVo> tableList = DataUtils.getTableList(table_Name_List);

        VoCreate.createEntity(tableList);
        XmlCreate.createXml(tableList);
        ModeFileCreate.createLogicFilesByMode(tableList);
        ModeFileCreate.createConfigFilesByMode();
    }

//        List<TableVo> tableList = DataUtils。getTableList();

}
